﻿@model NewsLetterSubscriptionTypeSearchModel

@{
    //page title
    ViewBag.PageTitle = T("Admin.Promotions.NewsLetterSubscriptionType").Text;
    //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("Newsletter subscription types");
}

<div class="content-header clearfix">
    <h1 class="float-left">
        @T("Admin.Promotions.NewsLetterSubscriptionType")
    </h1>
    <div class="float-right">
        <a href="@Url.Action("Create")" class="btn btn-primary">
            <i class="fas fa-square-plus"></i>
            @T("Admin.Common.AddNew")
        </a>
        @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.NewsLetterSubscriptionTypeListButtons, additionalData = Model })
    </div>
</div>

<section class="content">
    <div class="container-fluid">
        <div class="form-horizontal">
            <div class="cards-group">
                <div class="card card-default">
                    <div class="card-body">
                        <nop-doc-reference asp-string-resource="@T("Admin.Documentation.Reference.EmailCampaigns", Docs.EmailCampaigns + Utm.OnAdmin)" />
                        @await Html.PartialAsync("Table", new DataTablesModel
                        {
                            Name = "subscriptiontypes-grid",
                            UrlRead = new DataUrl("List", "NewsLetterSubscriptionType", null),
                            Length = Model.PageSize,
                            LengthMenu = Model.AvailablePageSizes,
                            ColumnCollection = new List<ColumnProperty>
                            {
                                new ColumnProperty(nameof(NewsLetterSubscriptionTypeModel.Name))
                                {
                                    Title = T("Admin.Promotions.NewsLetterSubscriptionType.Fields.Name").Text,
                                    Width = "300"
                                },
                                new ColumnProperty(nameof(NewsLetterSubscriptionTypeModel.TickedByDefault))
                                {
                                    Title = T("Admin.Promotions.NewsLetterSubscriptionType.Fields.TickedByDefault").Text,
                                    Width = "100",
                                    ClassName = NopColumnClassDefaults.CenterAll,
                                    Render = new RenderBoolean()
                                },
                                new ColumnProperty(nameof(NewsLetterSubscriptionTypeModel.DisplayOrder))
                                {
                                    Title = T("Admin.Promotions.NewsLetterSubscriptionType.Fields.DisplayOrder").Text,
                                    Width = "100",
                                    ClassName = NopColumnClassDefaults.CenterAll
                                },
                                new ColumnProperty(nameof(NewsLetterSubscriptionTypeModel.Id))
                                {
                                    Title = T("Admin.Common.Edit").Text,
                                    Width = "100",
                                    ClassName =  NopColumnClassDefaults.Button,
                                    Render = new RenderButtonEdit(new DataUrl("~/Admin/NewsLetterSubscriptionType/Edit/"))
                                }
                            }
                        })
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>